//
//  XLTabBar.m
//  MSCustomTabBarController
//
//  Created by 于鹏 on 2017/8/9.
//  Copyright © 2017年 MrSong. All rights reserved.
//

#import "XLTabBar.h"

@implementation XLTabBar

#pragma mark - Life Cycle

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        
        [self addSubview:self.tabBarView];
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    // 设置tabBarView的frame
    self.tabBarView.frame = self.bounds;
    // 把tabBarView带到最前面，覆盖tabBar的内容
    [self bringSubviewToFront:self.tabBarView];
}

#pragma mark - Getter 

- (XLTabBarView *)tabBarView {
    if (!_tabBarView) {
//        _tabBarView = [[XLTabBarView alloc]init];
        _tabBarView = [XLTabBarView tabBarView];
    }
    return _tabBarView;
}
@end
